<div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>
                        <vc:i18n name="申请放行" namespace="addStaff"></vc:i18n>
                    </h5>
                    <div class="ibox-tools" style="top:10px;">
                        <button type="button" class="btn btn-primary " v-on:click="vc.goBack()">
                            <i class="fa fa-close"></i><span>
                            <vc:i18n name="返回"></vc:i18n>
                        </button>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name='放行类型' namespace='addItemReleaseView'></vc:i18n>
                        </label>
                        <div class="col-sm-4">
                            <select class="custom-select" v-model="addItemReleaseViewInfo.typeId"
                                    @change="_changeItemReleaseType()">
                                <option selected disabled value="">
                                    {{vc.i18n('必填，请选择放行类型','addItemReleaseView')}}
                                </option>
                                <option :value="item.typeId"
                                        v-for="(item,index) in addItemReleaseViewInfo.itemReleaseTypes"
                                        v-if="item.state =='C'">
                                    {{item.typeName}}
                                </option>
                            </select>
                        </div>
                        <label class="col-sm-2 col-form-label text-right">
                            <span><vc:i18n name='申请单位' namespace='addItemReleaseView'></vc:i18n></span>
                        </label>
                        <div class="col-sm-4">
                            <input v-model="addItemReleaseViewInfo.applyCompany" type="text"
                                   :placeholder="vc.i18n('必填，请填写申请单位','addItemReleaseView')" class="form-control">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <span><vc:i18n name='申请人' namespace='addItemReleaseView'></vc:i18n></span>
                        </label>
                        <div class="col-sm-4">
                            <input v-model="addItemReleaseViewInfo.applyPerson" type="text"
                                   :placeholder="vc.i18n('必填，请填写申请人','addItemReleaseView')" class="form-control">
                        </div>
                        <label class="col-sm-2 col-form-label text-right">
                            <span><vc:i18n name='身份证' namespace='addItemReleaseView'></vc:i18n></span>
                        </label>
                        <div class="col-sm-4">
                            <input v-model="addItemReleaseViewInfo.idCard" type="text"
                                   :placeholder="vc.i18n('必填，请填写身份证','addItemReleaseView')" class="form-control">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <span><vc:i18n name='手机号' namespace='addItemReleaseView'></vc:i18n></span>
                        </label>
                        <div class="col-sm-4">
                            <input v-model="addItemReleaseViewInfo.applyTel" type="text"
                                   :placeholder="vc.i18n('必填，请填写手机号','addItemReleaseView')" class="form-control">
                        </div>
                        <label class="col-sm-2 col-form-label text-right">
                            <span><vc:i18n name='通行时间' namespace='addItemReleaseView'></vc:i18n></span>
                        </label>
                        <div class="col-sm-4">
                            <input v-model="addItemReleaseViewInfo.passTime" type="text"
                                   :placeholder="vc.i18n('必填，请填写通行时间','addItemReleaseView')"
                                   class="form-control addPassTime">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <span><vc:i18n name='车牌号' namespace='addItemReleaseView'></vc:i18n></span>
                        </label>
                        <div class="col-sm-4">
                            <input v-model="addItemReleaseViewInfo.carNum" type="text"
                                   :placeholder="vc.i18n('选填，请填写车牌号','addItemReleaseView')" class="form-control">
                        </div>
                        <label class="col-sm-2 col-form-label text-right">
                            <span><vc:i18n name='备注' namespace='addItemReleaseView'></vc:i18n></span>
                        </label>
                        <div class="col-sm-4">
                            <textarea v-model="addItemReleaseViewInfo.remark"
                                      :placeholder="vc.i18n('选填，请填写备注','addItemReleaseView')"
                                      class="form-control">
                            </textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <h5>
                        <span><vc:i18n name="放行物品" namespace="addItemReleaseView"></vc:i18n></span>
                    </h5>
                    <div class="ibox-tools" style="top:10px;">
                        <button type="button" class="btn btn-primary btn-sm" style="margin-right:10px;"
                                v-on:click="_addResName()">
                            <i class="fa fa-plus"></i>
                            <vc:i18n name="添加物品" namespace="addItemReleaseView"></vc:i18n>
                        </button>
                    </div>
                </div>
                <div class="ibox-content">
                    <table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
                        <thead>
                        <tr>
                            <th class="text-center">
                                <span><vc:i18n name="物品名称" namespace="addItemReleaseView"></vc:i18n></span>
                            </th>
                            <th class="text-center">
                                <span><vc:i18n name="物品数量" namespace="addItemReleaseView"></vc:i18n></span>
                            </th>
                            <th class="text-center">
                                <span><vc:i18n name="操作" namespace="addItemReleaseView"></vc:i18n></span>
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr v-for="res in addItemReleaseViewInfo.resNames">
                            <td class="text-center" style="vertical-align: inherit;">
                                <input v-model="res.resName" :placeholder="vc.i18n('必填，请填写物品名称','addItemReleaseView')"
                                       class="form-control" style="width: 70%;display:inline; margin: auto">
                            </td>
                            <td class="text-center" style="vertical-align: inherit;">
                                <input v-model="res.amount" type="number" class="form-control"
                                       :placeholder="vc.i18n('必填，请填写数量','addItemReleaseView')">
                            </td>
                            <td class="text-center" style="vertical-align: inherit;">
                                <button type="button" class="btn btn-danger btn-sm" style="margin-right:10px;"
                                        v-on:click="_removeResName(res.resName)">
                                    <vc:i18n name="移除" namespace="addItemReleaseView"></vc:i18n>
                                </button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="row" v-if="addItemReleaseViewInfo.audit.assignee == '-2'">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>
                        <span><vc:i18n name="审批人信息" namespace="addItemReleaseView"></vc:i18n></span>
                    </h5>
                    <div class="ibox-tools" style="top:10px;"></div>
                </div>
                <div class="ibox-content">
                    <div class="form-group row">
                        <label class="col-sm-2 col-form-label text-right">
                            <vc:i18n name="审批人" namespace="addItemReleaseView"></vc:i18n>
                        </label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control"
                                   :placeholder="vc.i18n('必填，请选择审批人','addItemReleaseView')" disabled
                                   v-model="addItemReleaseViewInfo.audit.staffName">
                        </div>
                        <div class="col-sm-2">
                            <button class="btn btn-white " type="button" v-on:click="chooseStaff()">
                                <i class="fa fa-search"></i> 选择
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <vc:create path="property/selectStaff"></vc:create>
    <div class="margin-top">
        <button class="btn btn-primary float-right" type="button" v-on:click="saveItemReleaseInfo()">
            <vc:i18n name="提交"></vc:i18n>
        </button>
        <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" v-on:click="vc.goBack()">
            <vc:i18n name="取消"></vc:i18n>
        </button>
    </div>
</div>